Allow Upper Case property names#1037
Conversation
|
I forgot to modify Behat scenarios |
|
I strongly encourage you to test it with a new entity instead of modifying an existing one. It will be less painful than editing Behat tests. |
ReflectionExtractor::getProperties() returns $id instead of $Id. It is bad naming convention, but is possible
```
use ApiPlatform\Core\Annotation\ApiProperty;
use Doctrine\ORM\Mapping as ORM;
class Entity {
/**
* @var string The dummy Guid
*
* @Orm\Column(nullable=true)
* @ApiProperty()
*/
protected $Id;
public function getId()
{
return $this->Id;
}
}
```
| /** | ||
| * Custom identifier dummy. | ||
| * | ||
| * @author Exploit.cz <insekticid@exploit.cz> |
There was a problem hiding this comment.
oh, cool. someone is reading my code
because of this
https://github.com/api-platform/core/blob/master/tests/Fixtures/TestBundle/Entity/CircularReference.php#L22
and this
https://github.com/api-platform/core/blob/master/tests/Fixtures/TestBundle/Entity/AbstractDummy.php#L22
etc
There was a problem hiding this comment.
lol no I wondered the same
IMO we should keep as @author the one who created the class not uppon each edit :). Should be fixed in other classes too. Still, what's the point of adding @author when we can git blame?
There was a problem hiding this comment.
@insekticid I have no problems with the @author tag but you made no changes on this class! 😄
Add it to the UpperCaseIdentifierDummy class instead, it's more relevant! 😉
|
Shouldn't we add a behat test case to check ? @dunglas |
|
@Simperfit no need to add a behat test here IMO, our behat suite is heavy enough (and painful to maintain too). The unit test covers the use case just fine! |
|
Sorry. I do not have any more time solving this simple stupid issue with
authoring this fix. I lost about 15hours of investigating bug with
xdebug+fix+phpunit. It is now up to you. You are allowed to change my pull.
…On 8 Apr 2017 1:11 a.m., "Baptiste Meyer" ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In tests/Fixtures/TestBundle/Entity/UuidIdentifierDummy.php
<#1037 (comment)>:
> @@ -17,6 +17,8 @@
/**
* Custom identifier dummy.
*
+ * @author Exploit.cz ***@***.***>
@insekticid <https://github.com/insekticid> I have no problems with the
@author tag but you made no changes on this class! 😄
Add it to the UpperCaseIdentifierDummy class instead, it's more relevant!
😉
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1037 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAK0vAl5144hR9T_-eHNLkFgITLhmdr0ks5rtsKOgaJpZM4M2zwl>
.
|
|
Don't worry I can do the change during the merge. |
|
Thanks @insekticid ! |
…ticid) This PR was merged into the 2.8 branch. Discussion ---------- Allow Upper Case property names in ObjectNormalizer | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no | BC breaks? | yes | Deprecations? | no | Tests pass? | yes | Fixed tickets | #22547 | License | MIT Same problem that has been fixed here #22265 and here api-platform/core#1037 ObjectNormalizer returns $id instead of $Id. It is bad naming convention, but is possible ```php class Entity { protected $Id; public function getId() { return $this->Id; } } ``` Commits ------- b2b4faa Allow Upper Case property names in ObjectNormalizer
| Q | A | ---------------- | ----- | Bug report? | yes | Feature request? | no | BC Break report? | yes | RFC? | no | Symfony version | 2.8.19 Same problem that has been fixed here symfony/symfony#22265 and here api-platform/core#1037 ObjectNormalizer returns $id instead of $Id. It is bad naming convention, but is possible ```php class Entity { protected $Id; public function getId() { return $this->Id; } } ```
…ticid) This PR was merged into the 2.8 branch. Discussion ---------- Allow Upper Case property names in ObjectNormalizer | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no | BC breaks? | yes | Deprecations? | no | Tests pass? | yes | Fixed tickets | #22547 | License | MIT Same problem that has been fixed here symfony/symfony#22265 and here api-platform/core#1037 ObjectNormalizer returns $id instead of $Id. It is bad naming convention, but is possible ```php class Entity { protected $Id; public function getId() { return $this->Id; } } ``` Commits ------- b2b4faa Allow Upper Case property names in ObjectNormalizer
Allow Upper Case property names
ReflectionExtractor::getProperties() returns $id instead of $Id. It is bad naming convention, but is possible